import request from '@/config/axios'

export interface TagVO {
  id: number
  name: string
  sort: number
  setId: number
}

// 查询企业标签分页
export const getTagPage = async (params) => {
  return await request.get({ url: `/ent/tag/page`, params })
}

// 查询企业标签详情
export const getTag = async (id: number) => {
  return await request.get({ url: `/ent/tag/get?id=` + id })
}

// 新增标签
export const createTag = async (data: TagVO) => {
  return await request.post({ url: `/ent/tag/create`, data })
}

// 修改企业标签
export const updateTag = async (data: TagVO) => {
  return await request.put({ url: `/ent/tag/update`, data })
}

// 删除企业标签
export const deleteTag = async (id: number) => {
  return await request.delete({ url: `/ent/tag/delete?id=` + id })
}

// 导出企业标签 Excel
export const exportTag = async (params) => {
  return await request.download({ url: `/ent/tag/export-excel`, params })
}



// 查询标签组分页
export const getTagGroupPage = async (params) => {
  return await request.get({ url: `/ent/tag-set/page`, params })
}
// 新增标签组
export const createTagGroup = async (data: TagVO) => {
  return await request.post({ url: `/ent/tag-set/create`, data })
}
// 编辑标签组
export const updateTagGroup = async (data: TagVO) => {
  return await request.put({ url: `/ent/tag-set/update`, data })
}
// 删除标签组
export const deleteTagGroup = async (id: number) => {
  return await request.delete({ url: `/ent/tag-set/delete?id=` + id })
}

// 企业标签集合
export const simpleList = async () => {
  return await request.get({ url: `/ent/tag/simple-list` })
}
